package cn.fintecher.gis.entity;

import cn.fintecher.gis.enums.CommonShow;
import cn.fintecher.gis.enums.FlowStatus;
import cn.fintecher.gis.enums.FlowType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "flow_info")
@Data
@ApiModel(value = "流程的相关管理", description = "流程的相关管理")
public class FlowInfo extends BaseEntity {

    @ApiModelProperty(notes = "类型")
    @Enumerated(EnumType.STRING)
    private FlowType type;

    @ApiModelProperty(notes = "申请业务id")
    private String applyId;

    @ApiModelProperty(notes = "申请时间")
    private Date applyTime;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "apply_user")
    @ApiModelProperty(notes = "申请人")
    private Operator applyUser;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "next_user")
    @ApiModelProperty(notes = "下一个审批人")
    private Operator nextUser;

    @ApiModelProperty(notes = "流程状态")
    @Enumerated(EnumType.STRING)
    private FlowStatus flowStatus;

    @ApiModelProperty(notes = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "是否开启流程")
    @Enumerated(EnumType.STRING)
    private CommonShow whether;
}
